import config from '../../config';
import { getFriends } from '../../api/index';

let app = getApp();

Page({
  data: {
    imgPrefix: config.IMG_PREFIX,
    arr: [],
    me: {}
  },

  onLoad() {
    app.getToken().then(() => {
      getFriends({
        success: res => {
          let { arr, me } = res.data.data;
          this.setData({
            arr,
            me
          });
        }
      });
    });
  },

  tapBack() {
    wx.navigateTo({
      url: '/pages/index/index'
    });
  }
});
